#ifndef __INPUTMANAGER_H__
#define __INPUTMANAGER_H__

namespace Input
{
	//--------------------------------------------------------------------
	//--------------------------------------------------------------------
	//--------------------------------------------------------------------

	class InputManager
	{
	private:
		InputManager();
		~InputManager();

	public:
		typedef unsigned char RawKeyboardInfo[256];
		typedef DIMOUSESTATE2 RawMouseInfo;

	public:
		static InputManager& GetInstance();

		bool Create(HINSTANCE& _hInst, HWND& _hWnd, DWORD _uCooperativeLevel = DISCL_FOREGROUND | DISCL_EXCLUSIVE);
		void Release();
		void Update();

		void GetRawKeyboardInfo(RawKeyboardInfo& _rInfo);
		void GetRawMouseInfo(RawMouseInfo& _rInfo);

		bool JustReleasedKey(const unsigned int& _uDIK) const;
		bool JustPressedKey(const unsigned int& _uDIK) const;

	protected:
		static InputManager s_oManager;

		LPDIRECTINPUT8			m_pDI;
		LPDIRECTINPUTDEVICE8	m_pKeyboard;
		LPDIRECTINPUTDEVICE8	m_pMouse;

		RawKeyboardInfo			m_oRawKeyboardInfo;
		RawKeyboardInfo			m_oOldRawKeyboardInfo;
		RawMouseInfo			m_oRawMouseInfo;
		RawMouseInfo			m_oOldRawMouseInfo;
	};
}

#endif // __INPUTMANAGER_H__